﻿define(['services/datacontext', 'services/logger', 'services/helpers','config'],
    function (dc,logger,helpers,config) {
        var car = ko.observable(),
            imageLocation = config.galleryImageLocation;
    

    function activate(routeData) {
        logger.log('Details View Activated', null, 'details', true);
        var id = parseInt(routeData.id);
        return dc.getCarBySessionId(id, car);
    }
    //#endregion

    var viewAttached = function (view) {
        helpers.displayGallery();
    };
        
    var vm = {
        car: car,
        activate: activate,
        title: 'Details View',
        viewAttached: viewAttached,
        imageLocation: imageLocation
    };

    return vm;


});